package com.heatup.apt.api.service;

import com.heatup.apt.model.api.ApiResultModel;
import com.heatup.apt.model.coupon.ActivityInfo;

import java.util.*;

/**
 *
 * @author Earvin
 *
 */
public interface CouponService {
	public enum Ret_ChangeType{
		Ret_Success(0,"温馨提示：兑换成功"),
		Ret_AlreadyChange(1,"温馨提示：该券已被兑换了"),
		Ret_NotFound(2,"温馨提示：没有该券"),
		Ret_InValid(3,"温馨提示：该券已经失效"),
		Ret_IsMax(4,"温馨提示：该券已被领满了"),
		Ret_BeforeTime(5,"温馨提示：该券的兑换时间还没到"),
		Ret_ExpiredTime(6,"温馨提示：该券的兑换时间已过"),
		Ret_NotMake(7,"温馨提示：无法生成优惠券"),
		Ret_Exchanged(8,"温馨提示：该批次优惠券您已兑换了"),
		Ret_Other(9,"温馨提示：未知错误");
		
		private int index;
		private String value;
		 
	    private Ret_ChangeType(int n, String value) {
	        this.index = n;
	        this.value = value;
	    }
	    
		public String getValue() {
			return value;
		}
	    	    
		public int getIndex() {
			return index;
		}
	};
	
	/**
	 * 获取用户优惠券列表
	 * @param map
	 * @return
	 */
	public Map<String, Object> queryUserCouponList(Map<String,Object> map);
		
	//领取(添加)优惠券 该接口主要给活动用
	public Ret_ChangeType addCouponDetail(Integer couponId, Integer userId, boolean canRepeat);
	
	
	//兑换优惠券,如果兑换成功，则直接返回最新的优惠券列表
	public ApiResultModel changeCoupon(Map<String, Object> paramsMap);
	
	//兑换优惠券 -本接口不对外了。 为了直接返回列表，再封装了上面的函数
	//public Ret_ChangeType changeCoupon(String change_code, Integer userId);
	
	//生成一个优惠券码
	public String generatorCouponCodeBy(Integer couponId);
	
	/**
	 * 根据活动id插入优惠券
	 * @param activity_id
	 * @param userId
	 * @return
	 */
	public Ret_ChangeType addCouponDetailByActivityId(Integer activity_id, Integer userId);
	
	
	public ApiResultModel queryCouponCodeByCouponId(Integer couponId);

	public Ret_ChangeType freeSecretCouponActivity(Integer userId, ActivityInfo activityInfo);

	public Map<String,Object> freeFristCouponActivity(Integer userId,Integer activityId);
	
}
